{include file="public/head"/}
<script>
    /*
     Handle jQuery plugin naming conflict between jQuery UI and Bootstrap
     解决 jQuery UI和Bootstrap 都使用tooltip 的冲突
     */
    $.widget.bridge('uibutton', $.ui.button);
    $.widget.bridge('uitooltip', $.ui.tooltip);
</script>
<div id="Vmain">
    <div class="container-fluid">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="alert alert-dismissable alert-info" id="headeralert">
                    <button type="button" class="close">×</button>
                    <p></p>
                </div>
            </div>
        </div>

        <div class="ntDesktop">
            <div class="ntDesktop-head">货柜内容</div>
            <div class="col-md-4">
                <button @click="oneexit" type="button" class="btn btn-default btn-checkbox"><input type="checkbox" checked> 显示货柜资料
                </button>
                    <button v-show="Left.status=='ARRIVE'" @click="twoexit" type="button" class="btn btn-default btn-checkbox"><input type="checkbox"> 选择还没入仓产品</button>
            </div>
            <div class="col-md-8 text-right">
                <div>
                    <a href="/admin/logistics/container" class="btn btn-default" stytle="margin-right:20px">
                        <span class="glyphicon glyphicon-chevron-left"></span> 返回列表
                    </a>
                    {in name="223" value="$Think.session.admin.auth_ids"}
                    <a v-show="Left.id!=0" :href="'/admin/logistics/containeredit?id='+Left.id" class="btn btn-primary" stytle="margin-right:20px" data-toggle="modal"
                       data-target="#container_editModal">
                        <span class="glyphicon glyphicon-pencil"></span> 编辑
                    </a>
                    {/in}

                    {in name="225" value="$Think.session.admin.auth_ids"}
                    <a v-if="Left.status=='LOADING'" href="#" class="btn btn-default" stytle="margin-right:20px" @click="apifun('etdday',1,Left.id,Left.name)">
                        <span class="fa fa-ship"></span> 开航
                    </a>
                    {/in}

                    {in name="226" value="$Think.session.admin.auth_ids"}
                    <a v-if="Left.status=='SALLING'" href="#" class="btn btn-default" stytle="margin-right:20px" @click="apifun('etaday',2,Left.id,Left.name)">
                        <span class="fa fa-shipping-fast"></span> 到港
                    </a>
                    {/in}

                    {in name="225" value="$Think.session.admin.auth_ids"}
                    <a v-if="Left.status=='SALLING'" href="#" class='btn btn-sm btn-primary' @click="apifun('etdday',11,Left.id,Left.name)">取消开航</a>
                    {/in}

                    {in name="226" value="$Think.session.admin.auth_ids"}
                    <a v-if="Left.status=='ARRIVE'" href="#" class='btn btn-sm btn-primary' @click="apifun('etaday',22,Left.id,Left.name)">取消到港</a>
                    {/in}

                    {in name="227" value="$Think.session.admin.auth_ids"}
                    <button v-if="Left.status=='ARRIVE'" class="btn btn-primary" data-toggle="modal" @click="openRUcang">
                    <span class="fa fa-dolly"></span> 入仓
                    </button>
                    {/in}

                    <a v-if="Left.status=='DISCHARGE'" href="#" class='btn btn-sm btn-primary'>已入仓</a>

                    {in name="360" value="$Think.session.admin.auth_ids"}
                    <!--货柜中有产品才显示打印按钮-->
                    <button v-if="listdata.length>0" class="btn btn-default" data-toggle="modal" data-target="#print_settingModal" stytle="margin-right:20px">
                        <span class="fa fa-print"></span> 打印
                    </button>
                    {/in}
                </div>
            </div>
            <div class="row">
                <div class="col-md-12" id="title_more">
                    <table class="table table-striped table-hover ntTable">
                        <tr>
                            <td>编号</td>
                            <td>{{formatUnit(Left.id,'ID')}}</td>
                            <td>名称</td>
                            <td>{{Left.name}}</td>
                            <td>代号</td>
                            <td>{{Left.code}}</td>
                            <td>货柜类型</td>
                            <td>{{Left.type_name}}</td>
                        </tr>
                        <tr v-if="isexitone">
                            <td>出发地/货贷</td>
                            <td colspan="3">{{Left.port_start_name}} / {{Left.co_id_start_name}}</td>
                            <td>目标地/货贷</td>
                            <td colspan="3">{{Left.port_arrival_name}} / {{Left.co_id_arrival_name}}</td>
                        </tr>
                        <tr v-if="isexitone">
                            <td>装柜日期</td>
                            <td>{{Left.ready_day==0?'':Left.ready_day}}</td>
                            <td>开航日期</td>
                            <td>{{Left.etd_day==0?'':Left.etd_day}}</td>
                            <td>到港日期</td>
                            <td>{{Left.eta_day==0?'':Left.eta_day}}</td>
                            <td>入仓日期</td>
                            <td>{{Left.arrival_day==0?'':Left.arrival_day}}</td>
                        </tr>
                        <tr v-if="isexitone">
                            <td>补料内容</td>
                            <td colspan="7">订舱单SO号:{{Left.so_no}} / 承运商：{{Left.carrier_id_name}} / 货柜号：{{Left.container_no}} / 封条号: {{Left.seal_no}} /
                                过磅重: {{formatUnit(Left.weight,'KGS')}} KGS / 箱数： {{formatUnit(Left.sum_ctn,'CTN')}} CTN / 提单号： {{Left.bl_no}}
                            </td>
                        </tr>
                        <tr v-if="isexitone">
                            <td>合计</td>
                            <td colspan="7">
                                重量： {{formatUnit(Left.sum_kgs,'KGS')}}<span class="unit">KGS</span> /
                                箱数： {{formatUnit(Left.sum_ctn,'CTN')}} <span class="unit">CTN</span> /
                                体积： {{formatUnit(Left.sum_cbm,'CBM')}}<span class="unit">CBM</span>
                                {neq name='Request.session.admin.position_id' value='65'}
                                /货值：{{formatUnit(Left.sum_value,'CNY')}}<span class="unit">CNY</span>
                                {/neq}
                            </td>
                        </tr>
                    </table>
                </div>
            </div>


            <div class="row">
                <div class="col-md-12" id="title_simple">
                    <table class="table table-striped table-hover ntTable">
                        <thead>
                        <tr>
                            <th class="text-center" style="vertical-align:middle">
                                <input type="checkbox" @change="selall" v-model="isallsel">
                            </th>
                            <th>&nbsp;</th>
                            <th>产品</th>
                            <th class="col-md-1">箱数</th>
                            <th>数量</th>
                            <th>重量</th>
                            <th>体积</th>
                            <th>金额</th>
                            <th>入仓</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <template v-for="(item,index) in listdata">
                            <tr class="tr-mid">
                                <td style="vertical-align:middle" align="center">
                                    <input type="checkbox" @change="selallgroup(index)" v-model="listdata[index].check">
                                </td>
                                <td colspan="4">
                                    <a href="po_detail">{{formatUnit(item.id,'ID')}}</a>
                                    /
                                    <a :href="'/admin/customer/companycheck?company_id='+item.company_id+'&tab=detail'" target="_blank">{{item.company_name}}</a>
                                    /
                                    交货：
                                    {{item.port_name}} / 交货时间
                                </td>
                                <td colspan="5" align="right">
                                    {{formatUnit(item.CTN,'CTN')}}<span class="unit">CTN</span> /
                                    {{formatUnit(item.KGS,'KGS')}}<span class="unit">KGS</span> /
                                    {{formatUnit(item.CBM,'CBM')}}<span class="unit">CBM</span>
                                    {neq name='Request.session.admin.position_id' value='65'}
                                    /{{formatUnit(item.CNY,'CNY')}}<span class="unit">CNY</span>
                                    {/neq}
                                </td>
                            </tr>
                            <tr v-for="(proitem,key) in item.buy_po_pack">
                                <td style="vertical-align:middle" align="center">
                                    <input type="checkbox" v-model="listdata[index].buy_po_pack[key].check" @change="selone(index,key,proitem.id)">
                                </td>
                                <td style="vertical-align:middle" align="center">
                                    <a href="pro_detail">
                                        <img :src="proitem.proinfo.img_url" border="0">
                                    </a>
                                </td>
                                <td>
                                    <small>
                                        {{
                                        proitem.proinfo.prochar_id+
                                        (proitem.proinfo.brand_name ? ' / '+proitem.proinfo.brand_name:'')+
                                        (proitem.proinfo.model ? ' / '+proitem.proinfo.model:'')
                                        }}
                                    </small>
                                    <br/>
                                    <a :href="'/admin/product/productDetail?request=detail&id='+proitem.pro_id"  target="_blank">
                                        {{proitem.proinfo.pro_name}}
                                    </a>
                                </td>
                                <td align="right">{{formatUnit(proitem.qty,'CTN')}}<span class="unit">CTN</span></td>
                                <td align="right">
                                    {{proitem.ctn_qty}} <span class="unit">PCS/CTN</span><br>
                                    {{proitem.sum_qty}} <span class="unit">PCS</span>
                                </td>
                                <td align="right">
                                    {{proitem.ctn_kgs}} <span class="unit">KGS/CTN</span><br>
                                    {{formatUnit(proitem.sum_kgs,'KGS')}}<span class="unit">KGS</span>
                                </td>
                                <td align="right">
                                    {{proitem.ctn_size}}<span class="unit">CM</span><br>
                                    {{proitem.ctn_m3}} <span class="unit">CBM/CTN</span> /
                                    {{formatUnit(proitem.sum_m3,'CBM')}}<span class="unit">CBM</span>
                                </td>
                                <td align="right">
                                    {neq name='Request.session.admin.position_id' value='65'}
                                    {{formatUnit(proitem.price,'CNY')}}<span class="unit">CNY</span><br>
                                    {{formatUnit(proitem.sum_price,'CNY')}}<span class="unit">CNY</span>
                                    {/neq}
                                </td>
                                <td>
                                    {{proitem.warehouse_name}} / {{proitem.warehouse_placeName}}<br>
                                    <small>{{proitem.warehouse_create}}</small>
                                </td>
                                <td align="right">
                                    {in name="227" value="$Think.session.admin.auth_ids"}
                                    <!--合同id， 采购id 产品id，角色id-->
                                    <button @click="warehousechange(item.id,proitem.id,proitem.pro_id,proitem.prochar_id)" class="btn btn-sm btn-default" v-if="proitem.warehouse_id">取消入仓</button>
                                    {/in}
                                </td>
                            </tr>
                        </template>
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="2" align="center">合计</td>
                            <td colspan="8" align="right">
                                <b>
                                    产品： {{formatUnit(combined.pronum,'UN')}}<span class="unit">UN</span> /
                                    箱数： {{formatUnit(combined.boxnum,'CTN')}}<span class="unit">CTN</span> /
                                    体积： {{formatUnit(combined.msnum,'CBM')}}<span class="unit">CBM</span> /
                                    重量： {{formatUnit(combined.weight,'KGS')}}<span class="unit">KGS</span>
                                    {neq name='Request.session.admin.position_id' value='65'}
                                    /金额： {{formatUnit(combined.maony,'CNY')}}<span class="unit">CNY</span>
                                    {/neq}
                                </b>
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--入仓弹框 开始-->
    <div class="modal fade" id="arrival_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel"
         aria-hidden="true">
        <div class="modal-dialog modal-lg" style="width:60%">
            <div class="modal-content">
                <div id="openmain">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="ntModalLabel">货柜内容转入指定仓库</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row clearfix">
                            <div class="col-md-12 column">
                                <div class="alert alert-dismissable alert-info">
                                    <button type="button" class="close">×</button>
                                    <p></p>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <table class="table table-hover ntTable">
                                    <tr>
                                        <td>货柜</td>
                                        <td>{{Left.id}} / {{Left.name}}</td>
                                    </tr>
                                    <tr>
                                        <td>入库内容</td>
                                        <td>{{formatUnit(combineddata.pronum,'UN')}} 个产品 /{{formatUnit(combineddata.boxnum,'CTN')}} <span class="unit">CTN</span> /
                                            {{formatUnit(combineddata.msnum,'CBM')}} <span class="unit">CBM</span> / {{formatUnit(combineddata.weight,'KGS')}} <span
                                                    class="unit">KGS</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>仓库<span class="required"></span></td>
                                        <td>
                                            <select class="form-control" @change="selWarehouse" v-model="selWarehouseVal">
                                                <option value="0">请选择...</option>
                                                <option :value="item.id" v-for="(item,index) in warehouse">{{item.name}}</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>位置<span class="required"></span></td>
                                        <td>
                                            <select class="form-control" v-model="locationval">
                                                <option value="0">{{location.length ? '请选择':'请选择仓库'}}</option>
                                                <option :value="item.id" v-for="(item,index) in location">{{item.name}}</option>
                                            </select>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal"><span
                                class="glyphicon glyphicon-remove"></span>取消
                        </button>
                        <button type="button" class="btn btn-primary" style="padding-left:24px;padding-right:24px" @click="saveFun">
                            <span class="glyphicon glyphicon-floppy-disk"></span>保存
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--货柜编辑 弹窗开始-->
    <div class="modal fade" id="container_editModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">

            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!-- 货柜打印设置-->
    <div class="modal fade" id="print_settingModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="ntModalLabel9">货柜打印设置</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="alert alert-dismissable alert-info">
                                <button type="button" class="close">×</button>
                                <h4> 信息框 </h4>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <table class="table table-hover ntTable">
                                <tbody>
                                <tr>
                                    <td class="col-md-2">语言<span class="required"></span></td>
                                    <td>
                                        <select class="form-control" v-model="dayin.langname">

                                            <option :value="item.code" v-for="(item,index) in langs">{{item.name}}</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="col-md-3">显示字体</td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.fontSize" value="1"> 小
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.fontSize"  value="2" checked> 中
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.fontSize"  value="3"> 大
                                        </label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>产品图片</td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.iconSize" value="1"> 不显示
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.iconSize" value="2" checked> 40x40px
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.iconSize" value="3"> 60x60px
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.iconSize" value="4"> 80x80px
                                        </label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>分隔</td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.separate" value="0"> 不显示
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.separate" value="1" checked> 显示采购单号/供应商/合计
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.separate" name="" value="2"> 显示采购单号/合计（不显示供应商）
                                        </label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>排序</td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.sort" value="1" checked> 默认（以品牌，型号和名称排序）
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.sort" value="2"> 以采购单的时间
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.sort" value="3"> 以产品的分类
                                        </label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>内容设置</td>
                                    <td>
                                        <div class="checkbox">
                                            <label><input type="checkbox" v-model="dayin.selectdata" value="1" >显示货柜ID</label>
                                        </div>
                                        <div class="checkbox">
                                            <label><input type="checkbox" v-model="dayin.selectdata" value="2" >显示货贷资料</label>
                                        </div>
                                        <div class="checkbox">
                                            <label><input type="checkbox" v-model="dayin.selectdata" value="3" >显示产品采购数量</label>
                                        </div>
                                        <div class="checkbox">
                                            <label><input type="checkbox" v-model="dayin.selectdata" value="4" >显示产品采购价格</label>
                                        </div>
                                        <div class="checkbox">
                                            <label><input type="checkbox" v-model="dayin.selectdata" value="5"
                                                          >显示产品CIF价格</label>
                                        </div>
                                        <div class="checkbox">
                                            <label><input type="checkbox" v-model="dayin.selectdata" value="6" >显示货柜备注内容</label>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>输出格式</td>
                                    <td>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.format" value="1" checked> 网页
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.format" value="2"> EXCEL
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" v-model="dayin.format" value="3"> PDF
                                        </label>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>

                    <button class="btn btn-info" @click="dayindata" style="padding-left:24px;padding-right:24px"><span
                            class="fa fa-print"></span>打印
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<!-- InstanceEndEditable -->
<script src="/static/Admin/js/condetail.js"></script>
<!--弹窗部分 结束-->
{include file="public/foot"/}
